/*
 * Copyright 2011-2012 by The Regents of the University of California Licensed
 * under the Apache License, Version 2.0 (the "License"); you may not use this
 * file except in compliance with the License. you may obtain a copy of the
 * License from
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package edu.ucsd.db.bassarisk.exception;

public class VisitorException extends Exception {
  private static final long serialVersionUID = -7829298238186093819L;;

  public static VisitorException expressionEliminated() {
    String msg =
        "Expression type should be eliminated before this visitor is "
            + "applied to a query.";
    return new VisitorException(msg);
  }

  public static VisitorException invalidNodeType() {
    String msg =
        "Visitor reached an invalid node type. The visitor was explicitly "
            + "designed to work only on trees without this node type.";
    return new VisitorException(msg);
  }

  public static VisitorException invalidVisitorType() {
    String msg =
        "Visitor reached a node that expects a visitor interface not provided"
            + "by the applied visitor.";
    return new VisitorException(msg);
  }

  public static VisitorException requireSubclassImplementation() {
    String msg = "Case must be covered by sub-class specific implementations.";
    return new VisitorException(msg);
  }

  private VisitorException(final String msg) {
    super(msg);
  }
}